package com.qijian.maindata.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.qijian.maindata.domain.AdjustFields;
import com.qijian.maindata.domain.query.AdjustFieldsQuery;
import com.qijian.maindata.mapper.AdjustFieldsMapper;
import com.qijian.maindata.service.IAdjustFieldsService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 调整字段Service业务层处理
 *
 * @author qijian
 * @date 2022-10-14
 */
@Service
@RequiredArgsConstructor
public class AdjustFieldsServiceImpl extends ServiceImpl<AdjustFieldsMapper, AdjustFields> implements IAdjustFieldsService {

    private final AdjustFieldsMapper adjustFieldsMapper;

    @Override
    public String selectAdjustedFields(QueryWrapper<AdjustFieldsQuery> query) {
        String adjustedFields = baseMapper.selectAdjustedFields(query);

        /*List<AdjustedFields> adjustedFieldsList = new ArrayList<>();
        if (StringUtils.isNotEmpty(adjustedFields)) {
            adjustedFieldsList = JSONArray.parseArray(adjustedFields, AdjustedFields.class);
        }*/
        return adjustedFields;
    }

    @Override
    public int deleteById(String id) {
        return baseMapper.removeById(id);
    }

}
